import request from '@/utils/request'
// 用户- 基本资料
export const userAPI = () => {
  return request({
    url: '/v1_0/user'
  })
}
// 用户 -个人资料
export const userProfileAPI = () => {
  return request({
    url: '/v1_0/user/profile'
  })
}
// 用户- 更新头像
// 值是formData对象
export const updatePhotoAPI = (formData) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'PATCH',
    data: formData
  })
}
//  用户_更新资料 /v1_0/user/profile
export const updateProfileAPI = ({ birthday, userName }) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'PATCH',
    data: {
      birthday,
      name: userName
    }
  })
}
// 更新用户已选列表传到后台
export const userChannelListAPI = ({ channels }) => {
  return request({
    url: '/v1_0/user/channels',
    method: 'PUT',
    data: {
      channels
    }
  })
}
